package com.example.test_15.logger;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class demo1 {
//    public static void main(String[] args) {
//        Logger logger= LoggerFactory.getLogger("第一个logger日志");
//        logger.info("123456");
//        System.out.println("sout:"+456789);
//    }

    private Logger logger=LoggerFactory.getLogger("abc");

    @RequestMapping("/logger")
    public String setLogger(){
        logger.info("12356");
        System.out.println("sout:"+456789);

        logger.trace("我是trace级别的日志");
        logger.debug("我是debug级别的日志");
        logger.info("我是info级别的日志");
        logger.warn("我是warn级别的日志");
        logger.error("我是error级别的日志");
        return "返回成功";
    }
}
